#include<iostream>
#include<cstring>
using namespace std;


int main() {

	int n;
	double *arr;
	cin >> n;
	arr = new double[n];
	cin>>*arr;
	int j=0;
	while(*(arr+j)!=9999){
		j++;
		cin>>*(arr+j);
		
	}

	for (int i = j-1; i > -1; i--) {
		cout << arr[i];
		if (i != 0) {
			cout << " ";
		}
	}

	delete arr;

	return 0;
}
